home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
oath.lha
/
oath
/
test
/
ms0.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-29
|
2KB
|
81 lines
#include "oath/minString.h"
/////////////////////////////////////////////////////////////////////////////
#include "../src/ensure.cc"
#include "../src/typeRegisterP.cc"
#include "../src/exportP.cc"
#include "../src/oathCore.cc"
#include "../src/obj.cc"
#include "../src/token.cc"
#include "../src/character.cc"
#include "../src/bag.cc"
#include "../src/queue.cc"
#include "../src/seq.cc"
#include "../src/fifoQueue.cc"
#include "../src/deq.cc"
#include "../src/list.cc"
#include "../src/string.cc"
#include "../src/dlcNodeP.cc"
#include "../src/minString.cc"
/////////////////////////////////////////////////////////////////////////////
// Test of minStrings
main()
{characterA R = characterA::make('r');
characterA S = characterA::make('s');
characterA T = characterA::make('t');
characterA L = characterA::make('l');
characterA N = characterA::make('n');
characterA E = characterA::make('e');
characterA A = characterA::make('a');
stringA Star = minStringA::make() << T << A << R;
cout << Star.am() << "\t(" << Star.hash() << ")" << endl;
stringA Sstare = minStringA::make() << S << Star << E;
cout << Sstare.am() << "\t(" << Sstare.hash() << ")" << endl;
stringPosA Pstare = Sstare.makePos();
cout << "First char is " << *Pstare << endl;
Pstare.findMatch("tar");
cout << "Char after tar is " << *Pstare << endl;
Pstare.reset();
if(Pstare.canMatch("sta"))
cout << "It can match 'sta', if you wish." << endl;
if(!!Pstare.match(""))
cout << "It just matched nothing successfully." << endl;
///
char * Buffer = new char [50];
for(int I = 0; I < 5; I++)
{for(int J = 0; J < 10; J++)
Buffer[I*10 + J] = J;
}
stringA Sbuffer = minStringA::make(Buffer, Buffer+42);
cout << "Sbuffer is " << Sbuffer.count() << " char's long." << endl;
char * Buffer2 = new char [40];
Sbuffer.charStarX(Buffer2, 40);
if(!memcmp(Buffer, Buffer2, 40))
cout << "Success! The buffers are the same!" << endl;
}